<?php
class User_Controller_Browse_Status_Add extends Nuo_Controller
{
	function execute($request)
	{
		$user = Nuo::getTable('user') -> find($request -> getParam('user_id')) -> current();

		$form = Nuo::getObject('user/status/add', 'form');

		$form -> isAsync();

		if ($request -> isPost() && $form -> isValid($_POST))
		{
			$data = $form -> getData();
			
			$result = Nuo::getApi('user')->updateUserStatus($data['status'], $user);

			return   'nuo.refresh();';
			return ;
		}
		return    $form->__toString();
	}

}
